<style>
<!--
.message {
	background-color:green;
	padding:10px;
}

.orderlist{
	color:white;
	width:100%;
	border:1px;
	text-align:center;
	
}
.orderlist tr td {
	border-color:blue;
	border:1px;
}
.orderlist tr td span {
	font-size: 13px;
	font-weight:bolder;
}
-->
</style>
<div id="content" class="w920" style="color:white;padding:14px 0 14px 0;">
	<h2 style="font-size:20px;font-weight:bold;margin-bottom:18px;">
	Hi, <?=$this->currentUser->name?>. Your Orders List here:</h2>
	<?php if($this->message){
		
		foreach( $this->message as $message){
		?>
		<div class="message"><?php echo $message;?></div>
	
	<?php 
		}
	}
	?>
	<div>
	<table class="orderlist">
			<tr>
			<td><span>Artwork</span></td>
			<td><span>Status</span></td>
			<td><span>Price</span></td>
			<td><span>Delivery Addr</span></td>
			<td><span>Receiver Name</span></td>
			<td><span>Delivery Type</span></td>
			<td><span>Delivery Cost</span></td>
			<td><span>Paypal Link</span></td>
			<!-- 
			<td>Message</td>
			<td>Created On</td>
			<td>Updated On</td>
			 -->
			</tr>
			
			<?php foreach($this->orders as $order){?>
			<tr>
			<td><?php echo $order->getArtwork()->name;?></td>
			<td><?php echo $order->status;?></td>
			<td><?php echo $order->currency . " " . $order->price;?></td>
			<td><?php echo $order->address . ", " . $order->city . ", " . $order->state . ", " . $order->country . ", " . $order->zipcode;?></td>
			<td><?php echo $order->receiver;?></td>
			<td><?php echo $order->delivery_type;?></td>
			<td><?php echo $order->delivery_cost ? $order->delivery_cost : "Not set";?></td>
			<td><?php 
			if($order->status == "accepted"){
			?>
				<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
					<input type="hidden" name="currency_code" value="<?php echo $order->currency;?>" /> <!-- or EUR -->
					<input type="hidden" name="amount" value="<?php echo $order->price;?>" /> <!-- price -->
					<input type="hidden" name="shipping" value="<?php echo $order->delivery_cost;?>" /> <!-- shipping cost -->
					<input type="hidden" name="item_name" value="<?php echo $order->getArtwork()->name;?>" /> <!-- artwork name -->
					<input type="hidden" name="item_number" value="<?php echo $order->getArtwork()->id;?>" /> <!-- artwork id -->
				
					<input type="hidden" name="return" value="http://www.artdepot.cn/index/thanks/order/<?php echo $order->id;?>/code/<?php echo md5($order->id.'HUIDALIAN');?>" /> <!-- page after completing payment -->
					<input type="hidden" name="email" value="<?php echo $this->currentUser->email;?>" /> <!-- customer email -->
					<input type="hidden" name="first_name" value="<?php echo $this->firstName;?>" /> <!-- first name -->
					<input type="hidden" name="last_name" value="<?php echo $this->lastName;?>" /> <!-- last name -->
					<input type="hidden" name="address1" value="<?php echo $order->address;?>" /> <!-- fill this -->
				
					<input type="hidden" name="city" value="<?php echo $order->city;?>" /> <!-- fill this -->
					<input type="hidden" name="country" value="<?php echo $order->country;?>" /> <!-- fill this -->
					<input type="hidden" name="state" value="<?php echo $order->state;?>" /> <!-- fill this -->
					<input type="hidden" name="zip" value="<?php echo $order->zipcode;?>" /> <!-- fill this -->
				
					<input type="hidden" name="quantity" value="1" />
					<input type="hidden" name="undefined_quantity" value="0" />
				
					<input type="hidden" name="no_shipping" value="1" />
					<input type="hidden" name="cmd" value="_xclick" />
					<input type="hidden" name="charset" value="utf-8" />
					<input type="hidden" name="business" value="artcangku@gmail.com">
					<input type="hidden" name="image_url" value="http://www.artdepot.cn/images/logo.jpg">
					<input type="image" src="http://www.artdepot.cn/images/btn_paynowCC_LG.gif" alt="Pay Now!" />
				</form>
			
			
			<?php 
			}
			?>
			</td>
			
			<!-- 
			<td><?php echo $order->message;?></td>
			<td><?php echo $order->created_on;?></td>
			<td><?php echo $order->updated_on;?></td>
			 -->
			</tr>
			
			<?php }?>
			
			</table>
	</div>
</div>